<?php defined('IN_PHPCMS') or exit('Access Denied'); ?><div id="digg">
<span>
<strong id="diggDivCount_<?php echo $contentid;?>">0</strong><br />
<samp id="diggDivDo_<?php echo $contentid;?>" onclick="digg(1)" >顶一下</samp>
</span>
<span class="cai">
<strong id="diggDivCount_down_<?php echo $contentid;?>">0</strong><br />
<samp id="diggDivDo_down_<?php echo $contentid;?>" onclick="digg(0)" >踩一下</samp>
</span>
</div>
<script type="text/javascript">
var digg_listurl = "<a href='<?php echo $MODULE['digg']['url'];?>?catid=<?php echo $r['catid'];?>' target='_blank' class='orange'>查看</a>";
$.get('<?php echo $MODULE['digg']['url'];?>digg.php?contentid=<?php echo $contentid;?>&id='+Math.random()*5, function(data){
 var data = data.split(',');
 $('#diggDivCount_<?php echo $contentid;?>').html(data[1]);
 $('#diggDivCount_down_<?php echo $contentid;?>').html(data[2]);
     if(data[0] == 1)
 {
 $('#diggDivDo_<?php echo $contentid;?>').html(digg_listurl);
 $('#diggDivDo_down_<?php echo $contentid;?>').html(digg_listurl);
 }
});
function digg(id)
{
if(id)
{
$.get('<?php echo $MODULE['digg']['url'];?>digg.php?contentid=<?php echo $contentid;?>&flag=1', function(data){
     if(data > 0) $('#diggDivCount_<?php echo $contentid;?>').html(data);
 $('#diggDivDo_<?php echo $contentid;?>').html(digg_listurl);
});
}
else
{
$.get('<?php echo $MODULE['digg']['url'];?>digg.php?contentid=<?php echo $contentid;?>&flag=0', function(data){
     if(data > 0) $('#diggDivCount_down_<?php echo $contentid;?>').html(data);
 $('#diggDivDo_down_<?php echo $contentid;?>').html(digg_listurl);
});
}
}
</script>